package com.novel.common.job;


import com.novel.utils.FormatDateZone;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 定时任务：
 * 不停止，每隔10s执行一次
 */
@Slf4j
@Component
public class TimeJob extends QuartzJobBean {

    /**
     * 定时任务job在这里编写
     */
    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) {
        System.out.println(DateFormatUtils.format(new Date(), FormatDateZone.Char_Millis_Seconds));
    }
}